import apiClient from './apiClient'

export const userService = {
  // 获取用户列表（分页）
  getUserList: async (params) => {
    return await apiClient.get('/users', { params })
  },

  // 根据ID获取用户
  getUserById: async (id) => {
    return await apiClient.get(`/users/${id}`)
  },

  // 创建用户
  createUser: async (userData) => {
    return await apiClient.post('/users', userData)
  },

  // 更新用户
  updateUser: async (id, userData) => {
    return await apiClient.put(`/users/${id}`, userData)
  },

  // 删除用户
  deleteUser: async (id) => {
    return await apiClient.delete(`/users/${id}`)
  },

  // 更新用户状态
  updateUserStatus: async (id, status) => {
    return await apiClient.put(`/users/${id}/status`)
  },

  // 获取用户总数
  getUserCount: async () => {
    return await apiClient.get('/users/count')
  }
}